<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>

<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title>完成任务</title> 


    <link type="text/css" href="/TopJUI/topjui/css/topjui.core.min.css" rel="stylesheet">
    <!-- 引入文件上传的css -->
	<link href="/pages/fileUpload/css/iconfont.css" rel="stylesheet" type="text/css"/>
	<link href="/pages/fileUpload/css/fileUpload.css" rel="stylesheet" type="text/css">
    <link type="text/css" href="/TopJUI/topjui/themes/default/topjui.green.css" rel="stylesheet" id="dynamicTheme"/>
    <!-- FontAwesome字体图标 -->
    <link type="text/css" href="/TopJUI/topjui/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
    <!-- 图片上传样式 -->
    <link type="text/css" href="/TopJUI/upload/css/upload.css" rel="stylesheet"/>
    <!-- jQuery相关引用 -->
    <script type="text/javascript" src="/TopJUI/topjui/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="/TopJUI/topjui/plugins/jquery/jquery.cookie.js"></script>
    <!-- TopJUI框架配置 -->
    <script type="text/javascript" src="/TopJUI/static/public/js/topjui.config.js"></script>
    <!-- TopJUI框架核心-->
    <script type="text/javascript" src="/TopJUI/topjui/js/topjui.core.min.js"></script>
    <!-- TopJUI中文支持 -->
    <script type="text/javascript" src="/TopJUI/topjui/js/locale/topjui.lang.zh_CN.js"></script>

    <script type="text/javascript" src="/pages/js/moment.min.js"></script>
    <script type="text/javascript" src="/pages/js/layer/layer.js"></script>
    <script type="text/javascript" src="/pages/js/util.js"></script>
    <script type="text/javascript" src="/pages/js/shuoheUtil.js"></script>
    
    <!-- 图片上传js -->
    <script type="text/javascript" src="/pages/fileUpload/js/fileUpload.js"></script>

    
    
<style type="text/css">
    html, body{ margin:0; height:100%;width: 100%;overflow: auto;}
</style>


<body>
      <table class="editTable" style="text-align: center;" >
        <tr>
            <td class="label" colspan="4" style="text-align: left;font-size: 20px;">
                <div class="divider">
                    <span style="margin-left: 10px">项目完成信息</span>
                </div>
            </td>
        </tr>
        <tr>
            <td>完成描述</td>
            <td >
                <input id="finish_describe"
                    class="easyui-textbox"
                    data-options="width:300,multiline:true,height:150"></td>
            </td>
        </tr> 
        <tr>
          <td>附件上传</td>
          <td>
            <div id="fileUploadContent" class="fileUploadContent"></div>
          </td>
        </tr>
    </table>
    <img alt="" src="" width="300px" height="250px">
    
<!--     <p>附件上传</p> -->
<!--     <div id="fileUploadContent" class="fileUploadContent"></div> -->
</body> 
</html>
<script type="text/javascript">


    var masterplan_id = shuoheUtil.getUrlHeader().masterplan_id;
    var project = new Object();
    $("#fileUploadContent").initUpload({
        "uploadUrl":"/pm2/project/uploadTaskFile.do",//上传文件信息地址
        "progressUrl":"#",//获取进度信息地址，可选，注意需要返回的data格式如下（{bytesRead: 102516060, contentLength: 102516060, items: 1, percent: 100, startTime: 1489223136317, useTime: 2767}）
        "selfUploadBtId":"selfUploadBt",//自定义文件上传按钮id
        "isHiddenUploadBt":false,//是否隐藏上传按钮
        "isHiddenCleanBt":true,//是否隐藏清除按钮
        "isAutoClean":false,//是否上传完成后自动清除
        "velocity":10,//模拟进度上传数据
        //"rememberUpload":true,//记住文件上传
       // "showFileItemProgress":false,
        //"showSummerProgress":false,//总进度条，默认限制
        //"scheduleStandard":true,//模拟进度的方式，设置为true是按总进度，用于控制上传时间，如果设置为false,按照文件数据的总量,默认为false
        //"size":350,//文件大小限制，单位kb,默认不限制
        "maxFileNumber":3,//文件个数限制，为整数
        //"filelSavePath":"",//文件上传地址，后台设置的根目录
        "beforeUpload":beforeUploadFun,//在上传前执行的函数
        "onUpload":onUploadFun,//在上传后执行的函数
         //autoCommit:true,//文件是否自动上传
        "fileType":["gif", "jpeg", "jpg", "bmp",'png','txt','pdf','doc','xls','xlsx','docx']//文件类型限制，默认不限制，注意写的是文件后缀

    });
    function beforeUploadFun(opt){
    	var arr = [];
    	var taskObj = {};
    	taskObj.name = "taskId";
    	taskObj.value = masterplan_id;
    	arr.push(taskObj);
    	opt.otherData =arr;
    	
    	return true;
    }
    function onUploadFun(opt,data){
        //写入硬盘成功后保存到数据库
        if(data.result==true){
        	layerMsgCustom('上传成功，请在附件中查看');
        }else{
        	layerMsgCustom('上传失败，请联系管理员');
        }
        //uploadTools.uploadError(opt);//显示上传错误
    }
    $(function()
    {
    	$('#finish_situation').combobox({
            url: '/develop/url/getUrl.do',
            valueField: 'id',
            textField: 'text',
            panelHeight: 200,
            method: 'get',
            multiple: false,
            queryParams: {
                'name': 'finishSituationSelect'
            },
            onSelect: function(rec){
          	  
            },
            onLoadSuccess: function() {}
        });
    });


    function save() {

        shuoheUtil.layerTopMaskOn();
        $.ajax({
            url:'/pm2/meeting/taskFeedback.do',
            type: "POST",
            dataType: 'json',
            data: {
                'master_plan_id': masterplan_id,
                'finish_describe':$('#finish_describe').textbox('getValue')
            },
            error: function() //失败
            {
                shuoheUtil.layerTopMaskOff();
            },
            success: function(data) //成功
            {
                shuoheUtil.layerTopMaskOff();
                if (data.result == true) {
                    shuoheUtil.layerClose();
                    parent.updateSuccess();
                } else
                    shuoheUtil.layerMsgCustom(data.describe);
            }
        });
    }

</script>